Chris Pollett > Old Classes >
CS134

( Print View )

Student Corner:
  [Grades Sec1]
  [Grades Sec2]

  [Submit Sec1]
  [Submit Sec2]

  [Email List Sec1]
  [Email List Sec2]

  [
Lecture Notes]

Course Info:
  [Texts & Links]
  [Topics]
  [Grading]
  [HW Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]

Practice Exams:
  [Mid1]  [Mid2]  [Final]

                           












HW#3 --- last modified March 02 2019 21:05:47..

Solution set.

Due date: Oct 27

Files to be submitted:
  Siege.zip

Purpose: To work with collisions, listeners, shooters, and do more with forces. To experiment with 3D. To be a last warm-up before you work on your own game.

Specification:

For this homework you are to build a 3D game to simulate attacking a castle using a trebuchet (a super catapult). You will submit your homework as a file Siege.zip containing your project file and all its necessary source files and resources. Make sure to have a readme.txt file so we know what to do with your project.

The idea of this game is that there is a castle at the center of the screen. The player controls a trebuchet/catapult which is at some radius from the center of the castle in the xz-plane. The left and right arrows move the player left and right along the circle in the xz-plane of this radius from the castle. The up and down arrows move the catapult in towards the castle or away from the castle along the same line from the center of the castle through the catapult. You should have a smallest and largest radius length that the player can be at. Holding down on the space bar winds up the trebuchet, releasing launches a stone at the castle. Shift and the up and down arrow keys controls the angle at which the catapult launches its ball. Encapsulate the motion controls into a cCatapultListener class and do the shooting by overriding your player critter's feellistener() approrpiately.

So that you don't forget your forces, you should have a gravity force applied to the ball launched by the cannon. To play with collisions you should have the walls of the castle take damage if they are hit and change their sprites according to how damaged they are. Inside and along the castle walls, but visible to the player of the game, you should see wall-fixing critters and archer critters. These two types of critters should be visually distinguishable. The wall-fixing critters try to bounce into the castle wall. When they do this they fix the wall. The archer critters are positioned along the castle walls but don't interact with it. They try to shoot and destroy the trebuchet if it is currently in their line of sight. If the trebuchet sustains enough damage the game should end. On the other hand, everytime the catapult manages to hit the castle walls, the player's score should go up. If the castle walls sustain enough damage there should be a win-game/increase level screen. You can either end the game at this point or if you are ambitious have higher levels of the game.

To get a good viewpoint for the game, consider a circle of radius larger than which the catapult can be on centered at the castle. Now somewhere on this circle imagine putting a crane of some fixed height in the y-direction and planting a camera which points at the center of the castle. Set this up so that one can always see the trebuchet and the castle from this camera.

Point Breakdown

Departmental coding guidelines for C++ followed/readme.txt file 2pts
cCatapultListener class is used to do motions as described 2pt
Shooting works as describe and is done in feellistener2pts
Catapult shot has a force of gravity on it when flying 1pt
Walls of castle can sustain damage as described 2pts
Wall-fixing critters work as described2pts
Archers work as described2pts
Viewpoint is set up as described2pts
Total15pts